<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style type="text/css">
.dateWidth1{
   width:195px;
}
.select_width{
   width:130px;
}
</style>
<x:parse xml="${param.xmlstr}" var="xmlData" />

<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfo"
	cellspacing="1">
	<tr >
		<td   colspan="4" class="t_bar2">基本信息</td>
	</tr>
	<tr >
		<td   align="right" width="20%"><span class="color_red">*</span>平台项目名称：</td>
		<td  colspan="3">
			<input id="zh_title" name="proposal/zh_title" label="平台项目名称" type="text"  class="input_css required maxlength:100"  style="width: 725px;" maxlength="100" value="<x:out select="$xmlData/data/proposal/zh_title" />"/> 
		</td>
	</tr>
	<tr  >
		<td   align="right" width="20%">项目类别：</td>
		<td  colspan="3">
			<x:out select="$xmlData/data/proposal/grant_name" /> 
		</td>
	</tr>
	
	<tr >
		<td align="right"><span class="color_red">*</span>项目类型：</td>
		<td nowrap  colspan="3" valign="middle">
			<c:set var="project_type_value"><x:out select="$xmlData/data/proposal/project_type_value" /></c:set>
			<cpt:checkbox key="project_type_2" name="project_type" repeatColumn="3" value="${project_type_value }" tagType="radio"></cpt:checkbox>
			<input type="hidden" name="proposal/project_type_value" id="project_type_value"  class="required"  value="<x:out select="$xmlData/data/proposal/project_type_value" />" label="项目类型" /> 
			<input type="hidden" name="proposal/project_type_name" id="project_type_name" value="<x:out select="$xmlData/data/proposal/project_type_name" />"  />
		</td>
	</tr>
	
	 
	<tr >
		<td  align="right" nowrap><span class="color_red">*</span>申报领域：</td>
		<td colspan="3">
				 <c:set var="grantCode"><x:out select="$xmlData/data/proposal/grant_code" /></c:set>
				<c:set var="sub"><x:out select="$xmlData/data/proposal/sub_grant_code" /></c:set>
				<c:set var="domain">{'id':'<x:out select="$xmlData/data/proposal/domain_value" />','name':'<x:out select="$xmlData/data/proposal/domain_name" />'}</c:set>
	          	<cpt:tree key="domain1" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${domain}"  label="申报领域"
	          		id="domain" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValue3" sqlParamVal="{grant_code:${sub},stat_year:${param.statYear}}"/>
		        <input id="domain_value" type="hidden" name="proposal/domain_value" class="required" label="申报领域" value="<x:out select="$xmlData/data/proposal/domain_value" />"/>
	            <input id="domain_name" type="hidden" name="proposal/domain_name"  value="<x:out select="$xmlData/data/proposal/domain_name" />"/>
				 <c:if test="${sub =='520' }">
				<input type="hidden" name="proposal/technosphere_value" id="technosphere_value" value="01" /> 
				<input type="hidden" name="proposal/technosphere_name" id="technosphere_name" value="工业" />
				</c:if>
				<c:if test="${sub =='521' }">
				<input type="hidden" name="proposal/technosphere_value" id="technosphere_value" value="02" /> 
				<input type="hidden" name="proposal/technosphere_name" id="technosphere_name" value="农业" />
				</c:if>
				<c:if test="${sub =='522' }">
				<input type="hidden" name="proposal/technosphere_value" id="technosphere_value" value="03" /> 
				<input type="hidden" name="proposal/technosphere_name" id="technosphere_name" value="社会发展" />
				</c:if> 
		</td>
	</tr>
	<tr >
		<td align="right"><span class="color_red">*</span>学科名称：</td>
	   <td  colspan="3">
	          	<c:set var="subject">{'id':'<x:out select="$xmlData/data/proposal/subject_code" />','name':'<x:out select="$xmlData/data/proposal/subject_name" />'}</c:set>
	          	<cpt:tree key="medically" cacheable="false" className="hn_iuput_kuang gray" readonly="true" value="${subject}"  label="学科名称"
	          		id="subject" showPattern="current" shieldPattern="0" topCheckbox="false" onClick="initTreeValue2" />
		        <input id="subject_code" type="hidden" name="proposal/subject_code" class="required" label="学科名称" value="<x:out select="$xmlData/data/proposal/subject_code" />"/>
	            <input id="subject_name" type="hidden" name="proposal/subject_name"  value="<x:out select="$xmlData/data/proposal/subject_name" />"/>
	   </td>
	</tr>
	<tr >
		<td align="right"><span class="color_red">*</span>归口管理部门：</td>
		<td colspan="3">
			<c:set var="recomend_org"><x:out select="$xmlData/data/proposal/recomend_org_value" /></c:set>
			<c:set var="sqOrgCode"><x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_code"/></c:set>
			<cpt:select id="recomend_org" sqlParamVal="{currentorgcode:${sqOrgCode }}"  key="proposal_tjbm"  value="${recomend_org}" onChange="initControlValue(this.id);"></cpt:select>
			<input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value" class="required" value="${recomend_org}" label="归口管理部门">
			<input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
		</td>
	</tr>
	
	 
	
	<tr >
		<td  align="right">平台项目负责人：</td>
		<td>
		    <span name="proposal/fzr_psnname" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" /></span>
		</td>
		<td  align="right">行政职务：</td>
		<td  >
			<span name="proposal/fzr_position" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/position" /></span>
		</td>
	 </tr> 
	 
	 
	 
	<tr >
	<td  align="right">工作单位：</td>
		<td  >
		<span name="proposal/fzr_org_name" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/org_name" /></span>
		</td>
		
		<td  align="right">技术职称：</td>
		<td  >
		<span name="proposal/fzr_prof_title_name"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/prof_title_name" /></span>
		</td>
	</tr> 
	<tr >
		<td  align="right">联系电话：</td>
		<td  >
			<span name="proposal/fzr_tel" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work" /></span>
		</td>
		<td  align="right">手机号码：</td>
		<td  >
			<span name="proposal/fzr_mobile" ><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" /></span>
		</td>
		
	</tr> 
	<tr >	
		<td  align="right">电子邮箱：</td>
		<td  >
			<span name="proposal/fzr_mail"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email" /></span>
		</td>
		
		<td  align="right"><span class="color_red">*</span>传真：</td>
		<td  >
				<c:set var="fax"><x:out select="$xmlData/data/proposal/fzr_fax" /></c:set>
			<c:if test="${fax =='' }">
				<c:set var="fax"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/fax" /></c:set>
			</c:if>
    	   <input name="proposal/fzr_fax" label="传真"  type="text" required class="input_css required"   maxlength="50" value="${fax }" style="width: 120px;"/> 
		</td>
	</tr> 
	 
	<tr >
	<td  align="right" nowrap><span class="color_red">*</span>开始日期：</td>
		<td >
			<c:set var="start_date"><x:out select="$xmlData/data/proposal/start_date" /></c:set>
			<cpt:date id="start_date" name="proposal/start_date" value="${start_date}" className="required date  dateCompare:end_date" label="项目开始日期" ></cpt:date> 
		</td>
		<td  align="right" nowrap width="120px;"><span class="color_red">*</span>结束日期：</td>
		<td>
			<c:set var="end_date"><x:out select="$xmlData/data/proposal/end_date" /></c:set>
			<cpt:date id="end_date" name="proposal/end_date" className="required date" label="项目结束日期"  value="${end_date}" ></cpt:date> 
		</td>
	</tr>
	<tr >
	    <td  align="right" nowrap width="20%"><span class="color_red">*</span>申报日期：</td>
		<td colspan="3">
			<c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
			<cpt:date id="submit_date" name="proposal/submit_date" value="${submit_date}" className=" required date" label="申报日期"></cpt:date> 
		</td>
	</tr>
	</table>
	
	<table class="t_css" width="100%" border="0" cellpadding="0" id="basicInfo2" cellspacing="1">
	<tr >
		<td class="t_bar2"><span class="color_red">*</span>平台定位与服务方向（限500字）</td>
	</tr>
	<tr >
       <td>
			<textarea rows="10" style="width: 898px;"  class="input_textarea required  maxlength:500"   name='proposal/summary1'  label="平台定位与服务方向"><x:out select="$xmlData/data/proposal/summary1"/></textarea>
		   <input type='hidden' name='proposal/summary1_hidden' id='proposal/summary1_hidden' value=''>
		 </td>
   </tr>
	</table>
	
	
	   <div class="t_bar">共建单位</div>
			 <table  id="tblAttendOrg" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
					<thead >
					<tr style="border:1px solid #B7D1E6">
						<th class="TblHead" align="center"  width="7%">选择</th>
						<th class="TblHead" align="center"  width="7%">序号</th>
						<th class="TblHead" align="center"  width="86%">单位名称</th> 
					</tr>
			</thead>
			<tbody id="tab">
					<tr style="display:none"  align="center">
						<td align="center">&nbsp;
							<input type="radio" class="radiobutton" name="selAttendOrg" >
						</td>
						<td align="center">&nbsp;
							<span name="attendorgs|attendorg[0]@seq_no" >[index]</span> 
						</td>
						<td align="center">
						<input name="attendorgs|attendorg[0]|cname" class="required input_text" label="单位名称"  value="" maxlength="50" style="width:90%">
						</td>
				</tr>
				
				<c:set value="0" var="index" scope="page"/>
					<x:forEach select="$xmlData/data/attendorgs/attendorg" var="attendorg">
					
					<c:choose>
						<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
						<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
					</c:choose>
					<tr  align="center">
						<td>&nbsp;
							<input type="radio" class="radiobutton" name="selAttendOrg" >
						</td>
						<td align="center">
							<span   name="attendorgs/attendorg[${flag}${index}]@seq_no" ><x:out select="$attendorg/@seq_no"/></span> 
						</td>
						<td >
						<input name="attendorgs/attendorg[${flag}${index}]/cname" class="required input_text" label="单位名称" value="<x:out select="$attendorg/cname"/>" maxlength="50" style="width:90%">
						</td>
						 
						</tr>
					<c:set value="${index+1}" var="index" scope="page"/>
					</x:forEach>
				</tbody>
					</table>
					
					<table width="98%" align="center" border="0">
					<tr style="border: 0"><td style="border: 0">
						<input class="button" name="cmdAddbefore" type=button value="添加" onclick="addNewRow('tblAttendOrg');try{top.resizeFrame();}catch(e){};">
						<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblAttendOrg','selAttendOrg')">
						<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblAttendOrg','selAttendOrg')">
						<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblAttendOrg','共建单位');">
						</td>
					</tr>
				</table>
	
	 
	 
<table class="t_css" width="100%" border="0" cellpadding="0" cellspacing="1" id="psn">
<tr>
		<td    class="t_bar2" colspan="8">人员信息</td>
	</tr>
<tr>
		<td  align="right" ><span class="color_red">*</span>项目联系人：</td>
		<td  >
			<input size="12"  name="proposal/contact_psn_cname" label="项目联系人姓名" type="text"  class="input_css required"   maxlength="100" value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />"/> 
		</td>
		<td  align="right"><span class="color_red">*</span>联系电话：</td>
		<td  >
			<input  name="proposal/contact_psn_tel" label="项目联系人联系电话"  type="text" class="input_css required"   maxlength="50" value="<x:out select="$xmlData/data/proposal/contact_psn_tel" />"/> 
		</td>
		<td  align="right"><span class="color_red">*</span>手机号码：</td>
		<td  >
			<input  name="proposal/contact_psn_mobile" label="项目联系人手机号码" type="text"  maxlength="11" required class="input_css required mobile"   maxlength="20" value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />"/> 
		</td>
		<td  align="right"><span class="color_red">*</span>电子邮箱：</td>
		<td  >
			<input  name="proposal/contact_psn_email" label="项目联系人电子邮箱" type="text"  class="input_css required email"   maxlength="100" value="<x:out select="$xmlData/data/proposal/contact_psn_email" />"/> 
		</td>
	</tr>
	
</table>
<script type="text/javascript">
	$(function(){
		cydw('org1');
		cydw('org2');
	})
function cydw(id){
	var count =0 ;
	$("#"+id).find("input[type='text']").each(function(){
		if($.trim($(this).val()) != ''){
			count +=1;
		}
	});
	if(count != 0){
		$("#"+id).find("input[type='text']").each(function(){
			$(this).addClass("required");
		});
		$("#"+id).find("span[id^='color']").each(function(){
			$(this).css('display','');
		});
	}else{
		$("#"+id).find("input[type='text']").each(function(){
			$(this).removeClass("required");
	});
		$("#"+id).find("span[id^='color']").each(function(){
			$(this).css('display','none');
		});
	}
}

function setProjectPlace(op){
	var address = $("#address_value").val();
	if(op) address = '${address}';
	$("#address_name_other").removeClass("required");
	if(address == '02'){
		$("#address_name_other_span").show();
		$("#address_name_other").css("display","");
		$("#address_name_other").addClass("required");
	}else{
		$("#address_name_other_span").hide();
		$("#address_name_other").removeClass("required");
		$("#address_name_other").val("");
	}
}
function initTreeValue2CallBack(){
	cydw('org1');
	cydw('org2');
}
function setEmptyValueForTree(id){
	$("#"+id).val("");
	$("#"+id+"_hideId").val("");
	$("#"+id+"_hideName").val("");
	$("#"+id+"_code").val("");
	$("#"+id+"_value").val("");
	$("#"+id+"_name").val("");
	$("#"+id + ",[name$='/"+id+"_code']" + ",[name$='/"+id+"_name'],[name$='/"+id+"_value']").val("");
	$("#sqdm").val("");
	cydw('org1');
	cydw('org2');
}

</script>

